﻿using Game.Map;
using Game.Map.Extensions;

namespace Game.Command.Internal
{
    static class AttackUtil
    {
        static public bool IsAttackPossible( IMapField attacker, 
                                             IMapField target)
        {
            if (attacker.VehicleX().Vehicle == null)
            {
                return false ;
            }
            
            if (target.VehicleX().Vehicle == null)
            {
                return false ;
            }
            
            if (attacker.VehicleX().Vehicle.Owner == target.VehicleX().Vehicle.Owner)
            {
                return false;
            }
            
            return true;
        }
    }
}
